package cn.rongdao.jrkabao.util.lifecycle;

import android.app.Activity;

import com.mifengkong.frtools.http.request.event.CompulsoryDownLineEvent;
import com.mifengkong.frtools.util.FRLog;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import cn.rongdao.jrkabao.ui.login.LoginActivity;

/**
 * Created by jack on 2018/5/18
 */

public class UIEventBusSubscribe extends EventBusAutoRegisterSubscribe {

    @Subscribe(threadMode = ThreadMode.MAIN) //在ui线程执行
    public void compulsoryDownLineMessage(CompulsoryDownLineEvent compulsoryDownLineEvent) {
        Activity activity = FRActivityLifecycle.getLastActivity();
        if (null == activity) {
            FRLog.error("");
            return;
        }
        FRActivityLifecycle.clear();
        LoginActivity.start(activity);
    }
}